<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="servlet.SelectState" %>
<%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Find Property</title>
<%	
	ArrayList state=new ArrayList();
	SelectState stateSelect=new SelectState();
	state=stateSelect.StateCitySelect();
%>
</head>
<script language="javascript">


var xmlrequest=false;  
xmlrequest=AjaxFunction();
function AjaxFunction()  
{  
     
	 try
		{	xmlrequest=new XMLHttpRequest(); 	}
		catch(e)
		{
			try{
				xmlrequest=new ActiveXObject("Msxml2.XMLHTTP");
			   }
			catch(e)
			   {
				   xmlrequest=new ActiveXObject("Microsoft.XMLHTTP");
			   }	   

		}
		return xmlrequest;	
}   
function showCity()  
{  
     var selectindex=document.getElementById("state").selectedIndex;
 	 var selectstate=document.getElementById("state").options[selectindex].text;
     var url="http://localhost:8181/PropertySite/getCityServlet";
         url=url+"?statename="+selectstate; 
      
     xmlrequest.open("GET",url,true);   
     xmlrequest.onreadystatechange=function()
     {
    	 if(xmlrequest.readyState==4)  
    	    {  
    	         if(xmlrequest.status==200)  
    	         {  
    	             document.getElementById("cityLoad").innerHTML=xmlrequest.responseText;  
    	         }  
    	    }    
     };    
     xmlrequest.send(null);  
}  
</script>

<body>
<div style="width:100%">
		<%@include file="Menu.jsp" %>
	</div>
 <table>
 	
 	<tr>
 		<td>
 			<p align="justify">
 			Property Studio  is providing a most desired Flats & Apartments property in Noida, Ghaziabad, South Delhi, Greater Noida for Sell Rent, All the Flats & Apartments are located at the most conducive Residential Property localities of Noida, Ghaziabad and Greater Noida.
			The Residential Properties that we have recorded in our database for buying and renting purpose, which are located in the best of the localities.
			</p>
 		</td>
 		<td width=20% bgcolor=Yellow><center><b>Contact Us</b></center>
  			<p align=right>A-61,1st Floor,Sector-65,Near Fortis Hospital
  			  	Noida,Uttar Pradesh<br></br>
        	<img src="<%=request.getContextPath()%>/Gallary/phone.png"></img><font color="red">+91-9899685362</font><br></br>
        	<img src="<%=request.getContextPath()%>/Gallary/phone.png"></img><font color="red">+91-9711087890</font>
        	</p> 
  </td>
 	</tr>
 	<tr>
 		<td>
 			<table>
 				<form name=find method=post>
 				<tr>
 					<td>Property Type</td>
 					<td><select>
 						<option>--Select--</option>
 						<option>Residential Multistorey Appartment</option>
 						<option>Commercial Space</option>
 						</select>
 					</td>
 				</tr>
 				<tr>
 					<td>Bedroom's</td>
 					<td><select><option>--select Bedroom--</option></select></td>
 				</tr>	
 				<tr>
 					<td>State</td>
 					<td><select id="state" onchange="showCity()"><option>--select state--</options>
							<%
								for(int i=0;i<state.size();i++)
								{
							%>
								<option ><%=state.get(i)%></option>
							<%	}	%>
							
 	 					</select>
 	 				</td>	
 				</tr>
 				<tr>
 					<td>City</td>
 				  
 					<td>
 						<span id="cityLoad">
 						<select id="city"><option>--select city--</option></select>	
 				  		</span>
 				  	</td>	
 				</tr>
 				<tr>
 					<td>Price </td>
 					<td><select id="minPrice">
 						<option>--select--</option>
 						<option>10</option>
 						<option>20</option>
 						<option>30</option>
 						<option>40</option>
 						<option>50</option>
 						<option>60</option>
 						<option>70</option>
 						<option>80</option>
 						<option>90</option>
 						<option>Above 1 crore</option>
 						</select>
 						To
 					</td>
 					<td>
 						<select id="maxPrice">
 						<option>--select--</option>
 						<option>10</option>
 						<option>20</option>
 						<option>30</option>
 						<option>40</option>
 						<option>50</option>
 						<option>60</option>
 						<option>70</option>
 						<option>80</option>
 						<option>90</option>
 						<option>Above 1 crore</option>
 						</select>
 					</td>
 				</tr>
 				<tr>
 					<td>
 						<input type=submit value="Search Now""></input>
 					</td>
 				</tr>
 				</form>
 			</table>			
 		</td>
 	</tr>
 	
 </table>
</body>
</html>